#include <stdlib.h>
#include <stdio.h>

#include "socket.h"
#include "maildir.h"
#include "logging.h"
#include "pop.h"

int main(int args, char **argv){

	int portno;
	int temp_port;
	char path[256]; // check
	char log[256]; // check

	if(args != 4){
		printf("USAGE: pop3 [port] [maildir path] [log file]\n");
		printf("NOTE: the maildir path must end with an '/'\n");
		exit(1);
	}
	else{
		
		temp_port = atoi(argv[1]);
		
		// printf("%d\n", temp_port); 	// for testing
		
		/* assign [port] argument to portno */
		if(temp_port < 0 || temp_port > 65535){	 // are well known ports okay?
			perror("ERROR invalid port number\n");
			printf("Possible port numbers 0 to 65535 inclusive");
			exit(1);
		}
		else{
			portno = temp_port;
		}
		
		/* specify path of maildir */
		if(1){
			perror("ERROR must end maildir path with / character");
			exit(1);
		}
		else{
			path = argv[2];
		}
		
		/* specify log file name */
		if(1){
			perror("ERROR incorrect format for logfile path");
			exit(1);
		}
		else{
			log = argv[3];
		}
		
		while(1){
			
		}
	
		
		
	}
	
	return 0;
}

